﻿<phone:PhoneApplicationPage 
    x:Class="Nok_Air.BookFlight.BookFlightPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
    xmlns:sys="clr-namespace:System;assembly=mscorlib"
    xmlns:local="clr-namespace:Nok_Air"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d" d:DesignHeight="800" d:DesignWidth="480"
    shell:SystemTray.IsVisible="False" FontFamily="/Nok Air;component/Fonts/Fonts.zip#PSL Display" FontSize="40">
	<phone:PhoneApplicationPage.Resources>
		<DataTemplate x:Key="NumSeatItemTemplate">
			<Grid Margin="0,-5">
				<TextBlock Text="{Binding}" d:LayoutOverrides="Width, Height" Foreground="Black" HorizontalAlignment="Center" TextAlignment="Center" FontSize="32" FontFamily="{StaticResource PhoneFontFamilyNormal}"/>
			</Grid>
		</DataTemplate>
	</phone:PhoneApplicationPage.Resources>

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" >
        <Grid.Resources>
            <DataTemplate x:Name="NumSeatFullModeItemTemplate">
                <Grid Tag="{Binding AirportCode}" VerticalAlignment="Center" Margin="0" HorizontalAlignment="Center" Width="480">
                	<Grid Background="#E5FFF2BE" VerticalAlignment="Center" Margin="32,12,32,0">
                		<TextBlock Text="{Binding}" Foreground="Black" FontSize="66.667" FontFamily="/Nok Air;component/Fonts/Fonts.zip#PSL Display" Margin="0,-8" HorizontalAlignment="Center"/>
                	</Grid>
                </Grid>
            </DataTemplate>
        </Grid.Resources>
        <Grid.RowDefinitions>
            <RowDefinition Height="70"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="80"/>
        </Grid.RowDefinitions>
        <Grid Style="{StaticResource TopAppBarStyle}">
        	<Grid.ColumnDefinitions>
    			<ColumnDefinition  Width="1*"/> 		
				<ColumnDefinition  Width="2*"/> 		
				<ColumnDefinition  Width="1*"/> 		
			</Grid.ColumnDefinitions>           
            <Button x:Name="backButton" Content="Back" HorizontalAlignment="Left"  Width="130" Margin="15,0,0,0" Height="60" Style="{StaticResource BackButtonStyle}" Foreground="White" Visibility="Collapsed" />
            <TextBlock x:Name="Title_checkIn_TextBlock" Margin="0" TextWrapping="Wrap" Text="{Binding BookFlightTitle}" FontSize="48" TextAlignment="Center" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="White" Grid.Column="1"/>
            <Button x:Name="continueButton" Content="{Binding Continue}" Style="{StaticResource BlueButtonStyle}" Margin="5,0" Click="bntNextSummary_Click" Foreground="White" VerticalAlignment="Center" FontSize="40" Grid.Column="2" />
        </Grid>
        <Grid Style="{StaticResource ContentStyle}"  Margin="0">
            <Grid Margin="35,10">
                <Grid.RowDefinitions>
                    <RowDefinition Height="0.20*"/>
                    <RowDefinition Height="1*"/>
                </Grid.RowDefinitions>
                <StackPanel Grid.Row="0">
                    <StackPanel Margin="0,10,0,0" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
                        <RadioButton Margin="2,0" GroupName="OneWayOrReturn" Width="180" Height="80" FontSize="48" x:Name="oneway" Content="{Binding OneWay}" Style="{StaticResource BlueRadioButtonStyle}" Click="oneway_Click" IsChecked="True"/>
                        <RadioButton Margin="2,0" GroupName="OneWayOrReturn" Width="180" Height="80" FontSize="48" x:Name="roundtrip" Content="{Binding RoundTrip}" Style="{StaticResource BlueRadioButtonStyle}" Click="roundtrip_Click"/>
                    </StackPanel>
                </StackPanel>
                <StackPanel Grid.Row="1" d:LayoutOverrides="VerticalMargin">
                    <StackPanel Margin="0,0,0,5">
                		<TextBlock Text="{Binding From}"  
                			Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Left"/>    		
                        <toolkit:ListPicker x:Name="airportScr2" ItemsSource="{Binding AvailableAirportItemsSrc}" VerticalAlignment="Center" Margin="0,-12,0,0" HorizontalAlignment="Stretch" HorizontalContentAlignment="Left"
			ItemTemplate="{StaticResource AirportItemTemplate}" ItemCountThreshold="1" FullModeItemTemplate="{StaticResource AirportFullModeItemTemplate}" CacheMode="BitmapCache" SelectionChanged="airportScr2_SelectionChanged"/>
                    </StackPanel>
                    <StackPanel Margin="0,0,0,5">
                        <TextBlock Text="{Binding To}"  
                    		Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Left"/>
                        <toolkit:ListPicker x:Name="airportDest2" ItemsSource="{Binding AvailableAirportItemsDest}" VerticalAlignment="Center" Margin="0,-12,0,0" HorizontalAlignment="Stretch" HorizontalContentAlignment="Left"
			ItemTemplate="{StaticResource AirportItemTemplate}" ItemCountThreshold="1" FullModeItemTemplate="{StaticResource AirportFullModeItemTemplate}" CacheMode="BitmapCache" SelectionChanged="airportDest2_SelectionChanged"/>
                    </StackPanel>
                    <Grid>
                    	<Grid.ColumnDefinitions>
                    		<ColumnDefinition Width="*"/>
							<ColumnDefinition Width="*"/>              	
						</Grid.ColumnDefinitions>
                    	<StackPanel d:LayoutOverrides="Height" Margin="0,0,6,0">
                    		<TextBlock Text="{Binding Depart}"  
                    			Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Left" d:LayoutOverrides="HorizontalAlignment"/>
                    		<toolkit:DatePicker x:Name="dateFlightDepart" ValueStringFormat="{}{0:dd/MM/yyyy}" FontSize="64" VerticalAlignment="Center" FontFamily="{StaticResource PhoneFontFamilyNormal}" ValueChanged="dateFlightDepart_ValueChanged" Margin="0,-12,0,0"/>
                    	</StackPanel>
                    	<StackPanel Grid.Column="1" Margin="6,0,0,0">
                    		<TextBlock x:Name="tbRetun" Text="{Binding Return}"  
                    			Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Left" Visibility="Collapsed"/>
                    		<toolkit:DatePicker x:Name="dateFlightReturn" ValueStringFormat="{}{0:dd/MM/yyyy}" FontSize="64" VerticalAlignment="Center" FontFamily="{StaticResource PhoneFontFamilyNormal}" Margin="0,-12,0,0" Visibility="Collapsed"/>
                    	</StackPanel>
                    </Grid>
                    <Grid>
                    	<Grid.ColumnDefinitions>
                    		<ColumnDefinition Width="*"/>
							<ColumnDefinition Width="*"/>              	
						</Grid.ColumnDefinitions>
                        <StackPanel Grid.Column="0">
                            <TextBlock Text="{Binding Adult}"  
                    			Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                            <toolkit:ListPicker x:Name="adultSeat" VerticalAlignment="Center" Margin="24,-12,24,0" ItemCountThreshold="2"
								FullModeItemTemplate="{StaticResource NumSeatFullModeItemTemplate}" CacheMode="BitmapCache" FontSize="32" ItemTemplate="{StaticResource NumSeatItemTemplate}"
								/>
                        </StackPanel>
                        <StackPanel Grid.Column="1">
                            <TextBlock Text="{Binding Children}"  
                    			Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                            <toolkit:ListPicker x:Name="childSeat" VerticalAlignment="Center" Margin="24,-12,24,0" HorizontalContentAlignment="Left" ItemCountThreshold="2"
								FullModeItemTemplate="{StaticResource NumSeatFullModeItemTemplate}" CacheMode="BitmapCache" ItemTemplate="{StaticResource NumSeatItemTemplate}"
								/>
                        </StackPanel>
                    </Grid>
                    <!--<Button x:Name="bntNextSummary"  Content="{Binding Next}" Style="{StaticResource BlueButtonStyle}" Height="60" Width="150" HorizontalAlignment="Right" Click="bntNextSummary_Click" d:LayoutOverrides="Height, VerticalMargin" Visibility="Collapsed"/>-->
                </StackPanel>
            </Grid>
        </Grid>
        <Grid Grid.Row="2">
            <local:AppBarMenuUserControl/>
        </Grid>
       <!-- <StackPanel x:Name="airportLayout" Orientation="Vertical" Grid.RowSpan="3" Margin="0,0,0,0" Visibility="Collapsed">
            <StackPanel.Background>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="#FFFFDE5F" Offset="1"/>
                    <GradientStop Color="#FFFFCB06"/>
                </LinearGradientBrush>
            </StackPanel.Background>
            <ListBox ItemsSource="{Binding AvailableAirportItems}" x:Name="airportListBox" Padding="0,0,0,0" Margin="0,5,0,0" Height="720" Background="{x:Null}" SelectionChanged="airportListBox_SelectionChanged">
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <Grid Tag="{Binding AirportCode}" VerticalAlignment="Center" Margin="0" d:LayoutOverrides="Height" HorizontalAlignment="Center" Width="480">
                            <Border VerticalAlignment="Center" Margin="20,5,20,5" CornerRadius="20" Tag="{Binding AirPortName}">
                                <StackPanel Margin="0">
                                    <TextBlock Text="{Binding AirPortName}" TextWrapping="Wrap" Foreground="Black" FontSize="40" Margin="0" FontFamily="/Nok Air;component/Fonts/Fonts.zip#PSL Display" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                    <TextBlock Text="{Binding AirportCode}" TextWrapping="Wrap" Margin="0,-12,0,0" Foreground="#99000000" FontFamily="/Nok Air;component/Fonts/Fonts.zip#PSL Display" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                </StackPanel>
                                <Border.Background>
                                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                        <GradientStop Color="#FFC0B6B6" Offset="0.51"/>
                                        <GradientStop Color="White" Offset="0.985"/>
                                        <GradientStop Color="#FFEFE7E7" Offset="0.031"/>
                                        <GradientStop Color="#FFEFEAEA" Offset="1"/>
                                    </LinearGradientBrush>
                                </Border.Background>
                            </Border>
                        </Grid>
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>
            <Button Content="{Binding Cancel}" Height="66" Margin="0,5,0,0" Style="{StaticResource ContinueButtonStyle}" Click="Cancel_Click" HorizontalAlignment="Center" VerticalAlignment="Center" Width="150" />
        </StackPanel>-->
    </Grid>
</phone:PhoneApplicationPage>